<template>
	<div class="wrapper"></div>
</template>

<script>
import Cookies from 'js-cookie'
import { fromPost, openHref, screenW, onSize } from '@/libs/tool'
import { commonLink } from '@/api/index.js'
import tabCard from '@/components/card/tabCard.vue'
export default {
	name: 'design-platform-oa',
	components: { tabCard },
	props: {},
	data() {
		return {
			cardTitleList1: [],
			userInfo: '', //用户信息
            accessToken: '',
            cardOa1:'',
            cardOa:'',
            linkUrl: [],
			Width: 0, //新闻宽度超出显示省略号
			screenWidth: screenW(), //屏幕宽度
		}
	},
	watch: {
		screenWidth(val) {
			this.screenWidth = val
			this.onWidth()
		},
	},
	computed: {},
	methods: {
		fromSummit: fromPost,
		openHref: openHref,
		init() {
			let userInfo = JSON.parse(Cookies.get('userInfo'))
			this.commonLink()
		},
		commonLink() {
			//常用链接
			commonLink({ num: 6 }).then((res) => {
				if (res.code == 200) {
					this.linkUrl = res.result
				} else {
					this.$Message.error(res.message)
				}
			})
		},
	    tabCardClick(item) {
      if (item.index == 0) {
        if (item.url1[0]) {
          this.fromSummit(item.url1[0].value, {
            authToken: this.accessToken,
            templateName: "donemoreinfo",
            infoID: null
          });
        }
      }
      if (item.index == 1) {
        if (item.url[0]) {
          this.fromSummit(item.url[0].value, {
            authToken: this.accessToken,
            templateName: "todomoreinfo",
            infoID: null
          });
        }
      }
    },
		onWidth() {
			let that = this
			setTimeout(function () {
				that.Width = that.$refs.list0.clientWidth - 160
			}, 0)
		},
	},
	created() {
		this.accessToken = this.getSession('accessToken')
		this.init()
	},
	mounted() {
		onSize(this, 'screenWidth') //监听赋值
		this.onWidth() //动态的添加宽度为了本页面的省略号才搞的
	},
}
</script>
<style lang="less" scoped>
.wrapper {
	width: 100%;
	height: 100%;
}
</style>
<style lang="less">
@import './less/home.less';
@import '../../styles/common.less';
.my-card {
	.ivu-card-body {
		padding: 10px 12px;
	}
}
.my-card1 {
	.ivu-card-body {
		padding: 0;
	}
}
</style>
<style scoped lang="less">
@import './less/page_home.less';
.demo-carousel {
	width: 100%;
	height: 100%;
}
.page_home_main {
	height: 100%;
}
.page_home_scroll {
	height: 100%;
	width: 100%;
}
</style>